{% extends "index.html" %}
{% block title %}自动安装系统{% endblock %}
{% block active_home %}class="active"{% endblock %}
{% block active_nav_home %}class="active"{% endblock %}
{% block body %}
<div class="container">
  <div class="row">
    <!--等待队列 span6-->
    <div class="span12">
      <form id="form-add-datacenter" class="well form-horizontal" action="/kis_cobbler/edit?id={{ servers.id }}" method='post'>
        {% csrf_token %}
        <div class="control-group">
          <label class="control-label" for="inputcobberserver">IDC机房</label>
          <div class="controls">
            <select class='cobblerserver' check-type="required" data-placeholder="选择机房" name='cobbler_server_id'>
              <option value=""></option> 
              {% for cobbler in cobbler_server %}
                <option value='{{ cobbler.id }}'>{{ cobbler.idc }}</option>
              {% endfor %}
            </select>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputprofile">安装系统</label>
          <div class="controls">
            <select class='profile' check-type="required" data-placeholder="选择需要安装的系统" name='profile'>
              <option value=""></option> 
            </select>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputmac">MAC地址</label>
            <div class="controls">
              <td><input type="text" name='mac' check-type="required" required-message="WARN:不能为空" placeholder="MAC地址" value="{{ servers.mac }}"></td>
            </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputeth0">eth0</label>
          <div class="controls">
            <td><input type="text" name='eth0' value="{{ servers.eth0 }}"></td>
            <span class="help-block">格式: 1.1.1.1/255.255.255.0</span>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputeth1">eth1</label>
          <div class="controls">
            <td><input type="text" name='eth1' value="{{ servers.eth1 }}"></td>
            <span class="help-block">格式: 1.1.1.1/255.255.255.0</span>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputeth0">hostname</label>
          <div class="controls">
            <td><input type="text" name='hostname' value="{{ servers.hostname }}"></td>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="inputpassword">password</label>
          <div class="controls">
            <td><input type="text" name='password' value="{{ servers.password }}"></td>
          </div>
        </div>
        <div class="controls">
          <a href='/' class="btn" >返回</a>
          <button class="btn btn-primary text-right" type="submit">保存配置</button>
        </div>
        <input type="hidden" name='id' value={{ servers.id }}> 
      </form>
    </div>
  </div>
</div>
<div id="messagemodal" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>任务详细</h3>
  </div>
  <div class="modal-body" id="messagebody">
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  </div>
</div>
{% endblock %}